<template>
  <div class="nav-header">
    <div class="nav-icon" @click="handleMenuIconClick">
      <el-icon size="20px">
        <component :is="isFold ? 'Expand' : 'Fold'"></component>
      </el-icon>
    </div>
    <div class="content">
      <crumbs></crumbs>
      <info></info>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import crumbs from './component/crumbs.vue'
import info from './component/info.vue'

const emits = defineEmits(['foldChange'])

const isFold = ref<boolean>(false)

const handleMenuIconClick = () => {
  isFold.value = !isFold.value
  emits('foldChange', isFold.value)
}
</script>

<style lang="scss" scoped>
.nav-header {
  display: flex;
  align-items: center;
  flex: 1;
  height: 100%;

  .nav-icon {
    display: flex;
    align-items: center;
    cursor: pointer;
  }

  .content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    padding: 0 18px;
  }
}
</style>
